home *** CD-ROM | disk | FTP | other *** search
Text File | 2010-11-09 | 67.7 KB | 1,526 lines |
- function §\x01\x02§()
- {
- return 1631 % 511 * 5;
- }
- var §\x01§ = 401 + "\x01\x02"();
- while(true)
- {
- if(eval("\x01") == 891)
- {
- set("\x01",eval("\x01") - 363);
- §§push(true);
- }
- else if(eval("\x01") == 569)
- {
- set("\x01",eval("\x01") + 369);
- §§push(eval(function §\x01\x02§()
- {
- return 1631 % 511 * 5;
- }));
- }
- else if(eval("\x01") == 250)
- {
- set("\x01",eval("\x01") + 228);
- }
- else if(eval("\x01") == 899)
- {
- set("\x01",eval("\x01") - 330);
- §§push("\x0f");
- }
- else
- {
- if(eval("\x01") == 178)
- {
- set("\x01",eval("\x01") - 24);
- break;
- }
- if(eval("\x01") == 938)
- {
- set("\x01",eval("\x01") - 515);
- §§push(!function §\x01\x02§()
- {
- return 1631 % 511 * 5;
- });
- }
- else if(eval("\x01") == 171)
- {
- set("\x01",eval("\x01") + 728);
- var §§pop() = function §\x01\x02§()
- {
- return 1631 % 511 * 5;
- };
- }
- else if(eval("\x01") == 423)
- {
- set("\x01",eval("\x01") - 389);
- if(function §\x01\x02§()
- {
- return 1631 % 511 * 5;
- })
- {
- set("\x01",eval("\x01") + 188);
- }
- }
- else if(eval("\x01") == 837)
- {
- set("\x01",eval("\x01") - 343);
- if(function §\x01\x02§()
- {
- return 1631 % 511 * 5;
- })
- {
- set("\x01",eval("\x01") - 261);
- }
- }
- else if(eval("\x01") == 34)
- {
- set("\x01",eval("\x01") + 188);
- }
- else
- {
- if(eval("\x01") == 222)
- {
- set("\x01",eval("\x01") - 141);
- if(!_global.com)
- {
- _global.com = new Object();
- }
- function §\x01\x02§()
- {
- return 1631 % 511 * 5;
- }
- if(!_global.com.evilfree)
- {
- _global.com.evilfree = new Object();
- }
- §§pop();
- if(!_global.com.evilfree.astroidsRevenge)
- {
- _global.com.evilfree.astroidsRevenge = new Object();
- }
- §§pop();
- if(!_global.com.evilfree.astroidsRevenge.Main)
- {
- var _loc2_ = com.evilfree.astroidsRevenge.Main = function(target_mc)
- {
- this.my_mc = target_mc.createEmptyMovieClip("main",1);
- this.userSettings = SharedObject.getLocal("asteroidsRevengeSettings");
- if(this.userSettings.data.musicVolume != undefined)
- {
- this.musicVolume = this.userSettings.data.musicVolume;
- }
- else
- {
- this.musicVolume = 30;
- this.userSettings.data.musicVolume = 30;
- }
- if(this.userSettings.data.soundVolume != undefined)
- {
- this.soundVolume = this.userSettings.data.soundVolume;
- }
- else
- {
- this.soundVolume = 100;
- this.userSettings.data.soundVolume = 100;
- }
- this.fakeRandom = new com.evilfree.astroidsRevenge.FakeRandom();
- this.musicList = [];
- this.musicList.push("dj-spooky-complete.mp3");
- this.mySqrt = Math.sqrt;
- this.mySin = Math.sin;
- this.myCos = Math.cos;
- this.myAtan = Math.atan2;
- this.radian = 57.29577951308232;
- this.levelWidth = 650;
- this.levelHeight = 500;
- this.levelRect = new flash.geom.Rectangle(0,0,this.levelWidth,this.levelHeight);
- this.levelPoint = new flash.geom.Point(0,0);
- this.myBitmap = new flash.display.BitmapData(this.levelWidth,this.levelHeight,false,0);
- this.backgroundBitmap1 = flash.display.BitmapData.loadBitmap("background1");
- this.backgroundBitmap2 = flash.display.BitmapData.loadBitmap("background2");
- this.backgroundMusic = new Sound(_root.musicSound_mc);
- Mouse.addListener(this);
- Key.addListener(this);
- }.prototype;
- _loc2_.createMovieClips = function()
- {
- this.my_mc.attachBitmap(this.myBitmap,3);
- this.astroids_mc = this.my_mc.createEmptyMovieClip("astroids",4);
- this.ships_mc = this.my_mc.createEmptyMovieClip("ships",5);
- this.sprite_mc = this.my_mc.createEmptyMovieClip("spriteEngine",9);
- this.line_mc = this.my_mc.createEmptyMovieClip("line",6);
- this.levelOverlay_mc = this.my_mc.createEmptyMovieClip("levelOverlay",20);
- this.levelExit_mc = this.my_mc.createEmptyMovieClip("levelExit",15);
- };
- _loc2_.startGame = function()
- {
- this.createMovieClips();
- _root.inGameMenu._visible = false;
- this.my_mc._visible = true;
- if(this.spriteLibrary == undefined)
- {
- this.spriteLibrary = new com.evilfree.astroidsRevenge.SpriteLibrary(this,this.sprite_mc);
- }
- this.myID = Math.round(Math.random() * 1000);
- this.currentLevel = _root.currentLevel;
- this.asteroidSpeed = _root.speed;
- this.asteroidArmor = _root.armor;
- this.asteroidSpin = _root.spin;
- this.bonusLevel = 0;
- this.shipCountNeededForNextLevel = 1;
- this.readyToExit = false;
- this.readyToStartNextLevel = false;
- this.backgroundNum = 1;
- this.gameIsOver = false;
- _root.bossDeathSize = 0;
- this.nextLevelCounter = 0;
- this.recordMode = false;
- this.playBackMode = false;
- this.setMouseDown = false;
- this.mouseDown = false;
- this.playerMouseX = 0;
- this.playerMouseY = 0;
- this.setRingDistance = 3;
- this.ringDistance = 3;
- this.astroidList = [];
- this.shipList = [];
- this.bulletList = [];
- this.shipCount = 1;
- var me = this;
- this.destroyCount = 1;
- this.previousDestroyCount = this.destroyCount * 5 - 2;
- this.mouseMode = true;
- this.playerScore = 0;
- this.asteroidMatrix = {};
- this.helpTime = 60;
- this.currentCount = 0;
- this.playerAstroid = new com.evilfree.astroidsRevenge.Astroid(this,this.astroids_mc,60,this.asteroidMatrix);
- this.playerAstroid.setPosition(500,500);
- this.playerAstroid.hilite();
- this.astroidList.push(this.playerAstroid);
- this.frameCount = _root.frameCount;
- this.gameIsPaused = false;
- this.loadLevel();
- this.my_mc.onEnterFrame = function()
- {
- me.enterFrame();
- };
- this.playMusic();
- };
- _loc2_.getTotalSize = function()
- {
- var _loc7_ = this.astroidList.length;
- var _loc6_ = 0;
- var _loc3_ = 0;
- while(_loc3_ < _loc7_)
- {
- var _loc4_ = this.astroidList[_loc3_];
- var _loc5_ = _loc4_.getSize();
- _loc6_ += Math.pow(_loc5_,2.4);
- _loc3_ = _loc3_ + 1;
- }
- _root.bossDeathSize = _loc6_;
- };
- _loc2_.getScore = function()
- {
- return this.destroyCount - 1;
- };
- _loc2_.getTimeScore = function()
- {
- return this.timeScore;
- };
- _loc2_.getMassScore = function()
- {
- return this.massScore;
- };
- _loc2_.get_mc = function()
- {
- return this.my_mc;
- };
- _loc2_.getAsteroidSpeed = function()
- {
- return this.asteroidSpeed * 0.5 + 1.5;
- };
- _loc2_.getAsteroidArmor = function()
- {
- return this.asteroidArmor - this.destroyCount / 400;
- };
- _loc2_.receiveRawPlayBackText = function(src)
- {
- var _loc2_ = src.split("|");
- this.mouseXArray = _loc2_[0].split(",");
- this.mouseYArray = _loc2_[1].split(",");
- this.mouseDownArray = _loc2_[2].split(",");
- this.mouseDeltaArray = _loc2_[3].split(",");
- this.startGame();
- };
- _loc2_.getSound_mc = function()
- {
- return _root.soundEffects_mc;
- };
- _loc2_.getPlayerInputs = function()
- {
- var _loc2_ = Math.abs(this.playerMouseX - this.my_mc._xmouse);
- var _loc3_ = Math.abs(this.playerMouseY - this.my_mc._ymouse);
- if(_loc2_ > 10 || _loc3_ > 10)
- {
- this.mouseMode = true;
- }
- this.playerMouseX = this.my_mc._xmouse;
- this.playerMouseY = this.my_mc._ymouse;
- if(Key.isDown(this.userSettings.data.close1) || Key.isDown(this.userSettings.data.close2))
- {
- this.setRingDistance -= 1;
- }
- if(Key.isDown(this.userSettings.data.away1) || Key.isDown(this.userSettings.data.away2))
- {
- this.setRingDistance += 1;
- }
- if(this.setRingDistance < 1)
- {
- this.setRingDistance = 1;
- }
- if(this.setRingDistance > 9)
- {
- this.setRingDistance = 9;
- }
- this.ringDistance = this.setRingDistance;
- if(Key.isDown(this.userSettings.data.release1) || Key.isDown(this.userSettings.data.release2))
- {
- this.mouseDown = true;
- }
- else
- {
- this.mouseDown = this.setMouseDown;
- }
- if(this.recordMode)
- {
- this.mouseXArray.push(this.playerMouseX);
- this.mouseYArray.push(this.playerMouseY);
- this.mouseDownArray.push(Number(this.mouseDown));
- this.mouseDeltaArray.push(this.ringDistance);
- }
- if(this.playBackMode)
- {
- this.playerMouseX = Number(this.mouseXArray[this.frameCount]);
- this.playerMouseY = Number(this.mouseYArray[this.frameCount]);
- this.mouseDown = Boolean(Number(this.mouseDownArray[this.frameCount]));
- this.ringDistance = Number(this.mouseDeltaArray[this.frameCount]);
- }
- };
- _loc2_.stopMusic = function()
- {
- this.backgroundMusic.stop();
- var _loc4_ = this.shipList.length;
- var _loc2_ = 0;
- while(_loc2_ < _loc4_)
- {
- var _loc3_ = this.shipList[_loc2_];
- _loc3_.stopSound();
- _loc2_ = _loc2_ + 1;
- }
- this.my_mc._visible = false;
- delete this.my_mc.onEnterFrame;
- };
- _loc2_.nextTrack = function()
- {
- this.playMusic();
- };
- _loc2_.playMusic = function()
- {
- var _loc3_ = this.musicList[this.currentTrack];
- this.backgroundMusic.attachSound("dj-spooky-complete.mp3");
- this.backgroundMusic.setVolume(this.musicVolume);
- this.backgroundMusic.start(0,500000);
- _root.music.text = _loc3_;
- };
- _loc2_.getPlayerAsteroid = function()
- {
- return this.playerAstroid;
- };
- _loc2_.loadLevel = function()
- {
- this.readyToStartNextLevel = false;
- this.readyToExit = false;
- this.nextLevelIsBonus = true;
- this.shipCountNeededForNextLevel = 0;
- if(this.currentLevel == 1)
- {
- this.autoSpawn = false;
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"training1",100);
- this.autoSpawn = false;
- this.createPlacedShip(-50,250,100,250,{type:"ship"});
- }
- if(this.currentLevel == 2)
- {
- this.autoSpawn = false;
- this.createShipColumn(750,550,140,475,15,{type:"ship"});
- this.createShipColumn(650,500,140,475,15,{type:"ship"});
- }
- if(this.currentLevel == 3)
- {
- this.createShipColumn(-250,50,150,475,15,{type:"ship"});
- this.createShipColumn(-175,100,150,475,15,{type:"ship"});
- this.createShipColumn(-100,150,150,475,15,{type:"ship"});
- this.createShipColumn(-25,200,150,475,15,{type:"ship"});
- }
- if(this.currentLevel == 4)
- {
- this.createShipRow(50,600,-50,100,15,{type:"ship"});
- this.createShipRow(50,600,600,450,15,{type:"ship"});
- }
- if(this.currentLevel == 5)
- {
- this.createShipColumn(-250,60,140,475,15,{type:"ship"});
- this.createShipColumn(-175,120,140,475,15,{type:"ship"});
- this.createShipColumn(800,590,140,475,15,{type:"ship"});
- this.createShipColumn(700,530,140,475,15,{type:"ship"});
- this.spreadShotClock();
- }
- if(this.currentLevel == 6)
- {
- this.levelAllyPickup = 0;
- var _loc3_ = 55;
- var _loc2_ = new com.evilfree.astroidsRevenge.ShipRepulse(this,this.ships_mc,_loc3_);
- this.shipCount = this.shipCount + 1;
- _loc2_.setPosition(-150,-150);
- _loc2_.setTarget(100,100);
- this.shipList.push(_loc2_);
- this.addPowerUp(700,425,600,425,"ally","levelAllyPickup");
- this.addPowerUp(700,60,600,60,"ally","levelAllyPickup");
- this.addPowerUp(-100,425,60,425,"ally","levelAllyPickup");
- }
- if(this.currentLevel == 7)
- {
- this.levelOverlay.destroy();
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"asteroidHelp2",100);
- _loc3_ = 90;
- _loc2_ = new com.evilfree.astroidsRevenge.ShipRepulse(this,this.ships_mc,_loc3_);
- this.shipCount = this.shipCount + 1;
- _loc2_.setPosition(750,-250);
- _loc2_.setTarget(480,150);
- this.shipList.push(_loc2_);
- }
- if(this.currentLevel == 8)
- {
- this.levelOverlay.destroy();
- _loc3_ = 90;
- _loc2_ = new com.evilfree.astroidsRevenge.ShipRepulse(this,this.ships_mc,_loc3_);
- this.shipCount = this.shipCount + 1;
- _loc2_.setPosition(750,-250);
- _loc2_.setTarget(480,80);
- this.shipList.push(_loc2_);
- _loc3_ = 90;
- _loc2_ = new com.evilfree.astroidsRevenge.ShipRepulse(this,this.ships_mc,_loc3_);
- this.shipCount = this.shipCount + 1;
- _loc2_.setPosition(750,650);
- _loc2_.setTarget(480,420);
- this.shipList.push(_loc2_);
- _loc3_ = 90;
- _loc2_ = new com.evilfree.astroidsRevenge.ShipRepulse(this,this.ships_mc,_loc3_);
- this.shipCount = this.shipCount + 1;
- _loc2_.setPosition(850,250);
- _loc2_.setTarget(480,250);
- this.shipList.push(_loc2_);
- this.addPowerUp(-100,425,60,425,"ally","levelAllyPickup");
- this.createShipColumn(750,550,40,460,20,{type:"ship"});
- this.createShipColumn(780,580,40,460,20,{type:"ship"});
- this.createShipColumn(810,612,40,460,20,{type:"ship"});
- }
- if(this.currentLevel == 9)
- {
- this.createShipRow(50,600,-50,100,15,{type:"ship"});
- this.createShipRow(50,600,600,450,15,{type:"ship"});
- this.setImmuneClock(300);
- }
- if(this.currentLevel == 10)
- {
- this.createShipColumn(-250,60,60,475,15,{type:"ship"});
- this.createShipColumn(800,590,60,475,15,{type:"ship"});
- this.createShipRow(90,600,-50,60,15,{type:"ship"});
- this.createShipRow(90,600,600,450,15,{type:"ship"});
- this.spreadShotClock();
- this.setImmuneClock(450);
- }
- if(this.currentLevel == 11)
- {
- this.backgroundNum = 2;
- this.createShipColumn(-50,60,60,475,8,{type:"minePlayer",size:40});
- }
- if(this.currentLevel == 12)
- {
- this.createShipColumn(-50,60,60,475,8,{type:"mineAlly",size:40});
- }
- if(this.currentLevel == 13)
- {
- this.createShipColumn(-50,60,60,475,3,{type:"mine",size:30});
- }
- if(this.currentLevel == 14)
- {
- this.createShipColumn(-50,70,60,475,20,{type:"ship",size:40});
- this.createShipColumn(-50,140,60,475,20,{type:"ship",size:40});
- this.createShipColumn(-50,200,60,475,12,{type:"mineAlly",size:30});
- }
- if(this.currentLevel == 15)
- {
- this.createShipColumn(-50,70,60,475,20,{type:"ship",size:40});
- this.createShipColumn(-50,140,60,475,20,{type:"ship",size:40});
- this.createShipColumn(-50,200,60,475,12,{type:"minePlayer",size:30});
- }
- if(this.currentLevel == 16)
- {
- this.createShipColumn(-100,100,250,250,1,{type:"fast",size:30});
- }
- if(this.currentLevel == 17)
- {
- this.createShipColumn(-100,100,120,450,7,{type:"fast",size:30});
- this.createShipColumn(650,550,120,450,7,{type:"fast",size:30});
- }
- if(this.currentLevel == 18)
- {
- this.createShipColumn(-100,100,120,450,14,{type:"fast",size:15,acceleration:2.5});
- this.createShipColumn(650,550,120,450,14,{type:"fast",size:15,acceleration:2.5});
- }
- if(this.currentLevel == 19)
- {
- this.createShipColumn(-50,70,60,475,20,{type:"ship",size:40});
- this.createShipColumn(-50,140,60,475,20,{type:"ship",size:40});
- this.createShipColumn(-75,200,60,475,8,{type:"mineAlly",size:30});
- this.createShipColumn(-50,250,60,475,8,{type:"minePlayer",size:30});
- this.addPowerUp(700,-100,600,100,"ally","none");
- }
- if(this.currentLevel == 20)
- {
- this.createShipColumn(-50,40,60,475,20,{type:"ship",size:40});
- this.createShipColumn(-50,80,60,475,20,{type:"ship",size:40});
- this.createShipColumn(-100,120,60,475,8,{type:"minePlayer",size:30});
- this.createShipColumn(-75,180,60,475,8,{type:"mineAlly",size:30});
- this.createShipColumn(-50,240,60,475,8,{type:"minePlayer",size:30});
- this.addPowerUp(700,-100,600,100,"ally","none");
- }
- if(this.currentLevel == 21)
- {
- this.createShipColumn(-50,40,60,475,20,{type:"ship",size:40});
- this.createShipColumn(-50,80,60,475,20,{type:"ship",size:40});
- this.createShipColumn(-100,100,60,475,8,{type:"minePlayer",size:30});
- this.createShipColumn(-75,160,60,475,8,{type:"mineAlly",size:30});
- this.createShipColumn(-50,220,60,475,8,{type:"minePlayer",size:30});
- this.createShipColumn(-50,280,60,475,8,{type:"mineAlly",size:30});
- this.addPowerUp(700,-100,600,100,"ally","none");
- }
- if(this.currentLevel == 22)
- {
- this.createShipColumn(-200,150,250,250,1,{type:"mine",size:200});
- this.addPowerUp(700,-100,600,100,"ally","none");
- }
- if(this.currentLevel == 23)
- {
- _loc3_ = 80;
- _loc2_ = new com.evilfree.astroidsRevenge.ShipRepulse(this,this.ships_mc,_loc3_);
- this.shipCount = this.shipCount + 1;
- _loc2_.setPosition(750,750);
- _loc2_.setTarget(520,400);
- this.shipList.push(_loc2_);
- this.createShipColumn(750,550,340,440,7,{type:"ship"});
- this.createShipColumn(775,575,340,440,7,{type:"ship"});
- this.createShipColumn(800,600,340,440,7,{type:"ship"});
- this.spreadShotClock();
- this.createShipRow(50,600,-50,20,15,{type:"ship"});
- this.createShipRow(50,600,600,450,15,{type:"ship"});
- _loc3_ = 60;
- _loc2_ = new com.evilfree.astroidsRevenge.ShipRepulse(this,this.ships_mc,_loc3_);
- this.shipCount = this.shipCount + 1;
- _loc2_.setPosition(-150,-150);
- _loc2_.setTarget(100,100);
- this.shipList.push(_loc2_);
- this.createShipColumn(-1500,50,150,475,15,{type:"ship"});
- this.createShipColumn(-1750,100,150,475,15,{type:"ship"});
- }
- if(this.currentLevel == 24)
- {
- this.createPlacedShip(-50,250,100,250,{type:"ship"});
- }
- if(this.currentLevel == 25)
- {
- this.autoSpawn = false;
- this.createShipColumn(750,550,140,475,15,{type:"ship"});
- this.createShipColumn(650,500,140,475,15,{type:"ship"});
- }
- if(this.currentLevel == 26)
- {
- _loc3_ = 70;
- _loc2_ = new com.evilfree.astroidsRevenge.ShipRepulse(this,this.ships_mc,_loc3_);
- this.shipCount = this.shipCount + 1;
- _loc2_.setPosition(750,750);
- _loc2_.setTarget(530,440);
- this.shipList.push(_loc2_);
- _loc3_ = 70;
- _loc2_ = new com.evilfree.astroidsRevenge.ShipRepulse(this,this.ships_mc,_loc3_);
- this.shipCount = this.shipCount + 1;
- _loc2_.setPosition(750,-100);
- _loc2_.setTarget(530,60);
- this.shipList.push(_loc2_);
- this.createShipColumn(750,450,60,475,12,{type:"mineAlly",size:30});
- this.createShipColumn(700,400,60,475,12,{type:"minePlayer",size:30});
- this.createShipColumn(750,550,100,200,2,{type:"fast",size:15,acceleration:2});
- this.createShipColumn(650,500,100,200,2,{type:"fast",size:15,acceleration:2});
- this.createShipColumn(750,550,320,420,2,{type:"fast",size:15,acceleration:2});
- this.createShipColumn(650,500,320,420,2,{type:"fast",size:15,acceleration:2});
- _loc3_ = 100;
- _loc2_ = new com.evilfree.astroidsRevenge.ShipBoss(this,this.ships_mc,_loc3_);
- this.shipCount = this.shipCount + 1;
- _loc2_.setPosition(700,250);
- _loc2_.setTarget(530,250);
- this.shipList.push(_loc2_);
- this.addPowerUp(-100,425,60,425,"ally","levelAllyPickup");
- }
- if(this.currentLevel == 27)
- {
- this.getTotalSize();
- this.saveTime();
- _loc3_ = 80;
- _loc2_ = new com.evilfree.astroidsRevenge.ShipRepulse(this,this.ships_mc,_loc3_);
- this.shipCount = this.shipCount + 1;
- _loc2_.setPosition(750,750);
- _loc2_.setTarget(520,400);
- this.shipList.push(_loc2_);
- this.addPowerUp(700,-100,600,100,"ally","none");
- this.addPowerUp(700,-100,500,100,"ally","none");
- this.autoSpawn = true;
- this.createShipColumn(-5500,50,150,475,15,{type:"ship"});
- this.createShipColumn(-5750,100,150,475,15,{type:"ship"});
- }
- };
- _loc2_.createLevelExit = function()
- {
- if(this.currentLevel == 1)
- {
- this.levelOverlay.destroy();
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"nextStageHelp",100);
- }
- if(this.currentLevel == 6)
- {
- this.levelOverlay.destroy();
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"nextStageHelp2",100);
- }
- this.levelExit = new com.evilfree.astroidsRevenge.LevelExit(this,this.levelExit_mc,300);
- this.levelExit.setPosition(325,250);
- this.levelExit.setTarget(300,300);
- };
- _loc2_.checkExit = function()
- {
- this.levelExit.animate();
- var _loc3_ = this.levelExit.checkAsteroids(this.astroidList);
- if(_loc3_)
- {
- this.nextLevelCounter = this.nextLevelCounter + 1;
- if(this.nextLevelCounter > 20)
- {
- if(this.readyToStartNextLevel == false)
- {
- if(this.nextLevelIsBonus)
- {
- this.nextBonusLevel();
- this.readyToExit = false;
- this.levelExit.get_mc().gotoAndPlay("leaveCircle");
- return undefined;
- }
- this.levelExit.get_mc().gotoAndStop("leaveCircle");
- this.levelOverlay.destroy();
- var _loc2_ = this.currentLevel + 1;
- if(_loc2_ == 2)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"training2",60);
- }
- if(_loc2_ == 3)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"training3",60);
- }
- if(_loc2_ == 4)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"tactics1",60);
- }
- if(_loc2_ == 5)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"tactics2",60);
- }
- if(_loc2_ == 6)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"ally1",60);
- }
- if(_loc2_ == 7)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"ally2",60);
- }
- if(_loc2_ == 8)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"ally3",60);
- }
- if(_loc2_ == 9)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"cloakRound1",60);
- }
- if(_loc2_ == 10)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"cloakRound2",60);
- }
- if(_loc2_ == 11)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"minesRound1",60);
- }
- if(_loc2_ == 12)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"minesRound2",60);
- }
- if(_loc2_ == 13)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"minesRound3",60);
- }
- if(_loc2_ == 14)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"mineDefensePlayer",60);
- }
- if(_loc2_ == 15)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"mineDefenseAlly",60);
- }
- if(_loc2_ == 16)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"fastShips1",60);
- }
- if(_loc2_ == 17)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"fastShips2",60);
- }
- if(_loc2_ == 18)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"fastShips3",60);
- }
- if(_loc2_ == 19)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"mineDefense2",60);
- }
- if(_loc2_ == 20)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"mineDefense3",60);
- }
- if(_loc2_ == 21)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"mineDefense4",60);
- }
- if(_loc2_ == 22)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"mineDefense5",60);
- }
- if(_loc2_ == 23)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"crazy1",60);
- }
- if(_loc2_ == 24)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"calm1",60);
- }
- if(_loc2_ == 25)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"calm2",60);
- }
- if(_loc2_ == 26)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"boss",60);
- }
- if(_loc2_ == 27)
- {
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"final",60);
- }
- }
- this.readyToStartNextLevel = true;
- }
- }
- else
- {
- this.nextLevelCounter = this.nextLevelCounter - 1;
- if(this.nextLevelCounter < 0)
- {
- this.nextLevelCounter = 0;
- }
- }
- if(_loc3_ == false && this.readyToStartNextLevel)
- {
- if(!this.nextLevelIsBonus)
- {
- this.levelOverlay.fadeOut();
- this.levelExit.get_mc().play();
- this.levelExit.destroy();
- this.nextLevel();
- }
- }
- };
- _loc2_.nextLevel = function()
- {
- this.currentLevel = this.currentLevel + 1;
- _root.currentLevel = this.currentLevel;
- this.loadLevel();
- };
- _loc2_.nextBonusLevel = function()
- {
- this.bonusLevel = this.bonusLevel + 1;
- this.loadBonusLevel();
- };
- _loc2_.loadBonusLevel = function()
- {
- if(this.currentLevel < 3)
- {
- this.shipCountNeededForNextLevel = 0;
- this.nextLevelIsBonus = false;
- this.levelOverlay.destroy();
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"bonus2",300);
- this.addPowerUp(325,650,325,425,"speed","none");
- }
- else
- {
- this.shipCountNeededForNextLevel = 4;
- this.nextLevelIsBonus = false;
- this.levelOverlay.destroy();
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"bonus1",300);
- this.addPowerUp(75,650,75,425,"armor","none");
- this.addPowerUp(200,650,200,425,"ally","none");
- this.addPowerUp(325,650,325,425,"grow","none");
- this.addPowerUp(450,650,450,425,"speed","none");
- this.addPowerUp(575,650,575,425,"spin","none");
- }
- };
- _loc2_.addPowerUp = function(startX, startY, endX, endY, powerType, event)
- {
- var _loc2_ = undefined;
- if(powerType == "ally")
- {
- _loc2_ = new com.evilfree.astroidsRevenge.PowerUpAlly(this,this.ships_mc,event);
- }
- if(powerType == "armor")
- {
- _loc2_ = new com.evilfree.astroidsRevenge.PowerUpArmor(this,this.ships_mc,event);
- }
- if(powerType == "speed")
- {
- _loc2_ = new com.evilfree.astroidsRevenge.PowerUpSpeed(this,this.ships_mc,event);
- }
- if(powerType == "grow")
- {
- _loc2_ = new com.evilfree.astroidsRevenge.PowerUpGrow(this,this.ships_mc,event);
- }
- if(powerType == "spin")
- {
- _loc2_ = new com.evilfree.astroidsRevenge.PowerUpSpin(this,this.ships_mc,event);
- }
- _loc2_.setPosition(startX,startY);
- _loc2_.setTarget(endX,endY);
- this.shipList.push(_loc2_);
- };
- _loc2_.createPlacedShip = function(xPos, yPos, targetX, targetY, shipOptions)
- {
- var _loc2_ = undefined;
- var _loc3_ = shipOptions.type;
- var _loc4_ = shipOptions.size;
- if(_loc3_ == undefined || _loc3_ == "ship")
- {
- _loc2_ = new com.evilfree.astroidsRevenge.Ship(this,this.ships_mc);
- }
- if(_loc3_ == "fast")
- {
- _loc2_ = new com.evilfree.astroidsRevenge.ShipFast(this,this.ships_mc,_loc4_);
- }
- if(_loc3_ == "mine")
- {
- _loc2_ = new com.evilfree.astroidsRevenge.ShipMine(this,this.ships_mc,_loc4_);
- }
- if(_loc3_ == "minePlayer")
- {
- _loc2_ = new com.evilfree.astroidsRevenge.ShipMinePlayer(this,this.ships_mc,_loc4_);
- }
- if(_loc3_ == "mineAlly")
- {
- _loc2_ = new com.evilfree.astroidsRevenge.ShipMineAlly(this,this.ships_mc,_loc4_);
- }
- if(shipOptions.acceleration != undefined)
- {
- _loc2_.setAcceleration(shipOptions.acceleration);
- }
- this.shipCount = this.shipCount + 1;
- _loc2_.setPosition(xPos,yPos);
- _loc2_.setTarget(targetX,targetY);
- this.shipList.push(_loc2_);
- };
- _loc2_.createShipColumn = function(startX, endX, startY, endY, num, shipOptions)
- {
- var _loc4_ = (endY - startY) / num;
- var _loc2_ = startY;
- var _loc3_ = 0;
- while(_loc3_ < num)
- {
- this.createPlacedShip(startX,_loc2_,endX,_loc2_,shipOptions);
- _loc2_ += _loc4_;
- _loc3_ = _loc3_ + 1;
- }
- };
- _loc2_.createShipRow = function(startX, endX, startY, endY, num, shipOptions)
- {
- var _loc4_ = (endX - startX) / num;
- var _loc2_ = startX;
- var _loc3_ = 0;
- while(_loc3_ < num)
- {
- this.createPlacedShip(_loc2_,startY,_loc2_,endY,shipOptions);
- _loc2_ += _loc4_;
- _loc3_ = _loc3_ + 1;
- }
- };
- _loc2_.receiveEvent = function(eventName)
- {
- if(eventName == "levelAllyPickup")
- {
- this.levelAllyPickup = this.levelAllyPickup + 1;
- }
- if(this.levelAllyPickup == 3)
- {
- this.levelAllyPickup = 0;
- this.levelOverlay.destroy();
- this.levelOverlay = new com.evilfree.astroidsRevenge.LevelOverlay(this,this.levelOverlay_mc,"asteroidHelp",30);
- }
- };
- _loc2_.spreadShotClock = function()
- {
- var _loc4_ = this.shipList.length;
- var _loc2_ = 0;
- while(_loc2_ < _loc4_)
- {
- var _loc3_ = this.shipList[_loc2_];
- _loc3_.setClockPercent(_loc2_ / _loc4_);
- _loc2_ = _loc2_ + 1;
- }
- };
- _loc2_.setImmuneClock = function(amount)
- {
- var _loc4_ = this.shipList.length;
- var _loc2_ = 0;
- while(_loc2_ < _loc4_)
- {
- var _loc3_ = this.shipList[_loc2_];
- _loc3_.setImmuneClock(amount);
- _loc2_ = _loc2_ + 1;
- }
- };
- _loc2_.createAsteroid = function(x, y, size)
- {
- var _loc2_ = new com.evilfree.astroidsRevenge.Astroid(this,this.astroids_mc,size,this.asteroidMatrix);
- _loc2_.setPosition(x,y);
- this.addAsteroid(_loc2_);
- };
- _loc2_.onMouseDown = function()
- {
- this.setMouseDown = true;
- };
- _loc2_.onMouseUp = function()
- {
- this.setMouseDown = false;
- };
- _loc2_.getMouseDown = function()
- {
- return this.mouseDown;
- };
- _loc2_.getSpriteLibrary = function()
- {
- return this.spriteLibrary;
- };
- _loc2_.onMouseWheel = function(delta)
- {
- this.setRingDistance += delta / 3;
- };
- _loc2_.getRingDistance = function()
- {
- return this.ringDistance * 10;
- };
- _loc2_.getBitmap = function()
- {
- return this.myBitmap;
- };
- _loc2_.caclulateInputs = function()
- {
- if(this.mouseMode)
- {
- var _loc2_ = this.playerMouseX - this.playerAstroid.getXPos();
- var _loc3_ = this.playerMouseY - this.playerAstroid.getYPos();
- var _loc4_ = Math.sqrt(_loc2_ * _loc2_ + _loc3_ * _loc3_);
- if(_loc4_ > 50)
- {
- var _loc5_ = 1;
- }
- else
- {
- _loc5_ = _loc4_ / 50;
- }
- var _loc6_ = this.myAtan(_loc3_,_loc2_);
- var _loc8_ = - this.myCos(_loc6_);
- var _loc7_ = - this.mySin(_loc6_);
- this.mouseAccX = _loc8_ * _loc5_;
- this.mouseAccY = _loc7_ * _loc5_;
- }
- };
- _loc2_.checkToAddAShip = function()
- {
- this.currentCount = this.currentCount + 1;
- if(this.currentCount == this.helpTime)
- {
- this.currentCount = 0;
- this.createNewShip();
- }
- };
- _loc2_.pauseGame = function()
- {
- this.gameIsPaused = true;
- };
- _loc2_.unPauseGame = function()
- {
- this.gameIsPaused = false;
- };
- _loc2_.enterFrame = function()
- {
- if(this.gameIsPaused)
- {
- return undefined;
- }
- if(this.gameIsOver)
- {
- return undefined;
- }
- this.asteroidMatrix = {};
- if(this.backgroundNum == 1)
- {
- this.myBitmap.copyPixels(this.backgroundBitmap1,this.levelRect,this.levelPoint);
- }
- if(this.backgroundNum == 2 || this.backgroundNum == 3)
- {
- this.myBitmap.copyPixels(this.backgroundBitmap2,this.levelRect,this.levelPoint);
- }
- if(this.backgroundNum == 4)
- {
- var _loc14_ = this.spriteLibrary.getBitmap("alphaBack1");
- this.myBitmap.copyPixels(this.backgroundBitmap2,this.levelRect,this.levelPoint,_loc14_,new flash.geom.Point(0,0),true);
- }
- if(this.backgroundNum == 5)
- {
- _loc14_ = this.spriteLibrary.getBitmap("alphaBack2");
- this.myBitmap.copyPixels(this.backgroundBitmap2,this.levelRect,this.levelPoint,_loc14_,new flash.geom.Point(0,0),true);
- }
- if(this.backgroundNum == 6)
- {
- _loc14_ = this.spriteLibrary.getBitmap("alphaBack3");
- this.myBitmap.copyPixels(this.backgroundBitmap2,this.levelRect,this.levelPoint,_loc14_,new flash.geom.Point(0,0),true);
- }
- if(this.backgroundNum == 7)
- {
- _loc14_ = this.spriteLibrary.getBitmap("alphaBack4");
- this.myBitmap.copyPixels(this.backgroundBitmap2,this.levelRect,this.levelPoint,_loc14_,new flash.geom.Point(0,0),true);
- }
- if(this.backgroundNum == 8)
- {
- this.myBitmap.fillRect(this.levelRect,0);
- }
- this.getPlayerInputs();
- this.frameCount = this.frameCount + 1;
- _root.frameCount = this.frameCount;
- _root.frameCountText.text = this.frameCount;
- this.caclulateInputs();
- if(this.autoSpawn)
- {
- this.checkToAddAShip();
- }
- var _loc13_ = this.astroidList.length;
- var _loc8_ = this.shipList.length;
- var _loc9_ = this.bulletList.length;
- var _loc12_ = undefined;
- var _loc10_ = 0;
- var _loc11_ = 0;
- var _loc4_ = 0;
- while(_loc4_ < _loc13_)
- {
- var _loc3_ = this.astroidList[_loc4_];
- var _loc5_ = _loc3_.getSize();
- _loc11_ += _loc5_ * _loc5_;
- if(_loc5_ > _loc10_)
- {
- _loc10_ = _loc3_.getSize();
- _loc12_ = _loc3_;
- }
- _loc3_.animate();
- _loc4_ = _loc4_ + 1;
- }
- if(_loc12_ != this.playerAstroid && this.mouseDown == false)
- {
- this.playerAstroid.unhilite();
- this.playerAstroid = _loc12_;
- this.playerAstroid.hilite();
- }
- this.playerAstroid.assignTargets();
- _root.life.text = "" + Math.round(_loc12_.getLife());
- _root.spinIndicator.text = "" + this.asteroidSpin;
- _root.armorIndicator.text = "" + this.asteroidArmor;
- _root.speedIndicator.text = "" + this.asteroidSpeed;
- if(this.currentLevel == 27)
- {
- _root.levelIndicator.text = "FINAL";
- }
- else
- {
- _root.levelIndicator.text = "Level " + this.currentLevel + " of 27";
- }
- _root.shipCount.text = "" + (this.destroyCount - 1);
- _loc4_ = 0;
- while(_loc4_ < _loc9_)
- {
- var _loc7_ = this.bulletList[_loc4_];
- _loc7_.animate();
- _loc4_ = _loc4_ + 1;
- }
- _loc4_ = 0;
- while(_loc4_ < _loc8_)
- {
- var _loc6_ = this.shipList[_loc4_];
- _loc6_.animate();
- _loc4_ = _loc4_ + 1;
- }
- _loc4_ = 0;
- while(_loc4_ < _loc9_)
- {
- _loc7_ = this.bulletList[_loc4_];
- _loc7_.drawMe();
- _loc4_ = _loc4_ + 1;
- }
- _loc4_ = 0;
- while(_loc4_ < _loc8_)
- {
- _loc6_ = this.shipList[_loc4_];
- _loc6_.drawMe();
- _loc4_ = _loc4_ + 1;
- }
- if(_loc8_ <= this.shipCountNeededForNextLevel && this.readyToExit == false)
- {
- while(this.shipList.length > 0)
- {
- this.shipList.pop().destroy();
- }
- this.readyToExit = true;
- this.nextLevelCounter = 0;
- this.createLevelExit();
- }
- if(this.readyToExit)
- {
- this.checkExit();
- }
- };
- _loc2_.addAsteroidSpeed = function(amount)
- {
- this.asteroidSpeed += amount;
- _root.speed = this.asteroidSpeed;
- };
- _loc2_.addAsteroidArmor = function(amount)
- {
- this.asteroidArmor += amount;
- _root.armor = this.asteroidArmor;
- };
- _loc2_.addAsteroidSpin = function(amount)
- {
- this.asteroidSpin += amount;
- _root.spin = this.asteroidSpin;
- };
- _loc2_.getAsteroidSpin = function()
- {
- return this.asteroidSpin + 1;
- };
- _loc2_.getAccelerationX = function(baseAcc)
- {
- if(this.mouseMode)
- {
- return (- baseAcc) * this.mouseAccX;
- }
- if(Key.isDown(this.userSettings.data.left1) || Key.isDown(this.userSettings.data.left2))
- {
- return - baseAcc;
- }
- if(Key.isDown(this.userSettings.data.right1) || Key.isDown(this.userSettings.data.right2))
- {
- return baseAcc;
- }
- return 0;
- };
- _loc2_.getAccelerationY = function(baseAcc)
- {
- if(this.mouseMode)
- {
- return (- baseAcc) * this.mouseAccY;
- }
- if(Key.isDown(this.userSettings.data.up1) || Key.isDown(this.userSettings.data.up2))
- {
- return - baseAcc;
- }
- if(Key.isDown(this.userSettings.data.down1) || Key.isDown(this.userSettings.data.down2))
- {
- return baseAcc;
- }
- return 0;
- };
- _loc2_.onKeyDown = function()
- {
- if(Key.isDown(this.userSettings.data.up1) || Key.isDown(this.userSettings.data.up2) || Key.isDown(this.userSettings.data.down1) || Key.isDown(this.userSettings.data.down2) || Key.isDown(this.userSettings.data.left1) || Key.isDown(this.userSettings.data.up2) || Key.isDown(this.userSettings.data.right1) || Key.isDown(this.userSettings.data.right2))
- {
- this.mouseMode = false;
- }
- if(Key.isDown(com.evilfree.KeyCodeHelper.P))
- {
- if(_root.inGameMenu._visible == true)
- {
- this.unPauseGame();
- _root.inGameMenu._visible = false;
- }
- else
- {
- this.pauseGame();
- _root.inGameMenu.setState();
- _root.inGameMenu._visible = true;
- }
- }
- if(this.debugMode)
- {
- if(Key.isDown(com.evilfree.KeyCodeHelper.T))
- {
- this.createAsteroid(200,200,50);
- }
- }
- };
- _loc2_.getStageWidth = function()
- {
- return this.levelWidth;
- };
- _loc2_.getStageHeight = function()
- {
- return this.levelHeight;
- };
- _loc2_.createNewShip = function()
- {
- if(this.shipList.length > 100)
- {
- return undefined;
- }
- if(this.shipCount % 500 == 0)
- {
- var _loc2_ = new com.evilfree.astroidsRevenge.PowerUpAlly(this,this.ships_mc,"none");
- }
- else if(this.shipCount % 400 == 0)
- {
- _loc2_ = new com.evilfree.astroidsRevenge.ShipMine(this,this.ships_mc,50 + this.destroyCount / 100);
- }
- else if(this.shipCount % 300 == 0)
- {
- _loc2_ = new com.evilfree.astroidsRevenge.ShipMinePlayer(this,this.ships_mc,50 + this.destroyCount / 100);
- }
- else if(this.shipCount % 100 == 0)
- {
- _loc2_ = new com.evilfree.astroidsRevenge.ShipRepulse(this,this.ships_mc,50);
- }
- else if(this.shipCount % 40 == 0)
- {
- _loc2_ = new com.evilfree.astroidsRevenge.ShipMineAlly(this,this.ships_mc,30 + this.destroyCount / 100);
- }
- else if(this.shipCount % 10 == 0)
- {
- _loc2_ = new com.evilfree.astroidsRevenge.ShipFast(this,this.ships_mc,30);
- }
- else
- {
- _loc2_ = new com.evilfree.astroidsRevenge.Ship(this,this.ships_mc);
- }
- if(this.currentLevel == 13)
- {
- _loc2_ = new com.evilfree.astroidsRevenge.ShipMine(this,this.ships_mc,25);
- }
- this.shipCount = this.shipCount + 1;
- if(this.shipCount > 1000 && this.currentLevel == 12)
- {
- return undefined;
- }
- var _loc3_ = this.getFakeRandom();
- var _loc5_ = this.getStageWidth() - 50;
- var _loc4_ = this.getStageHeight() - 50;
- if(_loc3_ > 0.75)
- {
- _loc2_.setPosition(-100,this.getFakeRandom() * this.getStageHeight());
- _loc2_.setTarget(this.getFakeRandom() * 200 + 25,this.getFakeRandom() * _loc4_ + 25);
- }
- else if(_loc3_ > 0.5)
- {
- _loc2_.setPosition(this.getFakeRandom() * this.getStageWidth(),-100);
- _loc2_.setTarget(this.getFakeRandom() * this.getStageWidth() + 25,this.getFakeRandom() * 150 + 25);
- }
- else if(_loc3_ > 0.25)
- {
- _loc2_.setPosition(this.getStageWidth() + 100,this.getFakeRandom() * this.getStageHeight());
- _loc2_.setTarget(this.getFakeRandom() * 150 + this.getStageWidth() - 175,this.getFakeRandom() * _loc4_ + 25);
- }
- else
- {
- _loc2_.setPosition(this.getFakeRandom() * this.getStageWidth(),this.getStageHeight() + 100);
- _loc2_.setTarget(this.getFakeRandom() * this.getStageWidth() + 25,this.getFakeRandom() * 150 + this.getStageHeight() - 175);
- }
- this.shipList.push(_loc2_);
- };
- _loc2_.getFakeRandom = function()
- {
- var _loc2_ = this.frameCount + this.playerMouseX + this.playerMouseY;
- return this.fakeRandom.getRandom(_loc2_);
- };
- _loc2_.createBullet = function(xPos, yPos, angle, damageAmount)
- {
- var _loc2_ = new com.evilfree.astroidsRevenge.Bullet(this,this.bullet_mc);
- _loc2_.setDamage(damageAmount);
- var _loc6_ = Math.cos(angle / this.radian);
- var _loc5_ = Math.sin(angle / this.radian);
- var _loc4_ = 3 * _loc6_;
- var _loc3_ = 3 * _loc5_;
- _loc2_.setVelocity(_loc4_,_loc3_);
- _loc2_.setPosition(xPos + _loc4_ * 1,yPos + _loc3_ * 1);
- this.bulletList.push(_loc2_);
- };
- _loc2_.removeBullet = function(b)
- {
- var _loc4_ = this.bulletList.length;
- var _loc2_ = 0;
- while(_loc2_ < _loc4_)
- {
- if(this.bulletList[_loc2_] == b)
- {
- this.bulletList.splice(_loc2_,1);
- b.destroy();
- break;
- }
- _loc2_ = _loc2_ + 1;
- }
- };
- _loc2_.removeShip = function(s)
- {
- if(this.previousDestroyCount != this.destroyCount * 5 - 2)
- {
- _root.gotoAndPlay(1);
- }
- this.destroyCount = this.destroyCount + 1;
- this.previousDestroyCount = this.destroyCount * 5 - 2;
- var _loc4_ = this.shipList.length;
- this.playerScore += 10 * _loc4_;
- var _loc3_ = 0;
- while(_loc3_ < _loc4_)
- {
- if(this.shipList[_loc3_] == s)
- {
- this.shipList.splice(_loc3_,1);
- break;
- }
- _loc3_ = _loc3_ + 1;
- }
- if(this.autoSpawn)
- {
- this.createNewShip();
- }
- };
- _loc2_.addAsteroid = function(astroid)
- {
- this.astroidList.push(astroid);
- };
- _loc2_.removeAstroid = function(astroid)
- {
- var _loc5_ = this.astroidList.length;
- if(this.astroidList.length == 1 && this.astroidList[0] == astroid)
- {
- var _loc3_ = undefined;
- while(_loc3_ < this.shipList.length)
- {
- this.shipList[_loc3_].stopSound();
- _loc3_ = _loc3_ + 1;
- }
- this.playerAstroid = new com.evilfree.astroidsRevenge.Astroid(this,this.astroids_mc,60,this.asteroidMatrix);
- this.playerAstroid.setPosition(1500,1500);
- this.playerAstroid.hilite();
- this.astroidList.push(this.playerAstroid);
- this.gameIsOver = true;
- if(this.currentLevel < 27)
- {
- _root.ending = 1;
- }
- else
- {
- _root.ending = 2;
- if(this.destroyCount >= 3000)
- {
- _root.ending = 3;
- }
- if(this.destroyCount >= 6000)
- {
- _root.ending = 4;
- }
- }
- _root.gotoAndPlay("Game Over");
- if(!this.recordMode)
- {
- }
- _root.kongregateScores.submit(this.destroyCount);
- _root.gameOver.destroyed.text = "Ships Destroyed: " + (this.destroyCount - 1);
- if(this.currentLevel < 27)
- {
- _root.gameOver.mass.text = "BOSS STILL LIVES!";
- _root.gameOver.time.text = "BOSS STILL LIVES!";
- }
- else
- {
- var _loc6_ = Math.sqrt(_root.bossDeathSize);
- _loc6_ = Math.round(_loc6_ * 100);
- _root.gameOver.mass.text = "Mass: " + _loc6_;
- this.massScore = _loc6_;
- _root.gameOver.time.text = "Time: " + this.timeScore;
- }
- }
- else
- {
- _loc3_ = 0;
- while(_loc3_ < _loc5_)
- {
- if(this.astroidList[_loc3_] == astroid)
- {
- this.astroidList.splice(_loc3_,1);
- if(astroid == this.playerAstroid)
- {
- this.playerAstroid = this.astroidList[0];
- this.playerAstroid.hilite();
- }
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- };
- _loc2_.saveTime = function()
- {
- var _loc2_ = this.frameCount / 30;
- var _loc3_ = Math.floor(_loc2_ / 60);
- _loc2_ -= _loc3_ * 60;
- _loc2_ = Math.round(_loc2_ * 100) / 100;
- this.timeScore = "" + _loc3_ + ":" + _loc2_;
- };
- _loc2_.getAsteroidsFromGrid = function(gridX, gridY)
- {
- return this.asteroidMatrix[gridX + "_" + gridY];
- };
- _loc2_.addToAsteroidGrid = function(gridX, gridY, asteroid)
- {
- if(this.asteroidMatrix[gridX + "_" + gridY] == undefined)
- {
- this.asteroidMatrix[gridX + "_" + gridY] = [];
- }
- this.asteroidMatrix[gridX + "_" + gridY].push(asteroid);
- };
- _loc2_.getAstroidList = function()
- {
- return this.astroidList;
- };
- _loc2_.getShipList = function()
- {
- return this.shipList;
- };
- _loc2_.getRandomAstroid = function()
- {
- var _loc3_ = this.astroidList.length;
- var _loc2_ = Math.floor(this.getFakeRandom() * _loc3_);
- return this.astroidList[_loc2_];
- };
- _loc2_.getMusicVolume = function()
- {
- return this.musicVolume;
- };
- _loc2_.getSoundVolume = function()
- {
- return this.soundVolume;
- };
- _loc2_.setMusicVolume = function(v)
- {
- this.musicVolume = v;
- this.userSettings.data.musicVolume = v;
- this.backgroundMusic.setVolume(v);
- };
- _loc2_.setSoundVolume = function(v)
- {
- this.soundVolume = v;
- this.userSettings.data.soundVolume = v;
- var _loc4_ = this.shipList.length;
- var _loc2_ = 0;
- while(_loc2_ < _loc4_)
- {
- var _loc3_ = this.shipList[_loc2_];
- _loc3_.adjustVolume();
- _loc2_ = _loc2_ + 1;
- }
- };
- _loc2_.mouseXArray = [];
- _loc2_.mouseYArray = [];
- _loc2_.mouseDownArray = [];
- _loc2_.mouseDeltaArray = [];
- §§push(ASSetPropFlags(com.evilfree.astroidsRevenge.Main.prototype,null,1));
- }
- §§pop();
- break;
- }
- if(eval("\x01") == 478)
- {
- set("\x01",eval("\x01") - 307);
- §§push("\x0f");
- §§push(1);
- }
- else if(eval("\x01") == 233)
- {
- set("\x01",eval("\x01") + 245);
- }
- else if(eval("\x01") == 528)
- {
- set("\x01",eval("\x01") - 350);
- if(function §\x01\x02§()
- {
- return 1631 % 511 * 5;
- })
- {
- set("\x01",eval("\x01") - 24);
- }
- }
- else if(eval("\x01") == 154)
- {
- set("\x01",eval("\x01") + 427);
- }
- else if(eval("\x01") == 847)
- {
- set("\x01",eval("\x01") - 266);
- }
- else
- {
- if(eval("\x01") != 581)
- {
- if(eval("\x01") == 494)
- {
- set("\x01",eval("\x01") - 261);
- break;
- }
- if(eval("\x01") == 81)
- {
- set("\x01",eval("\x01") - 81);
- }
- break;
- }
- set("\x01",eval("\x01") + 256);
- §§push(true);
- }
- }
- }
- }
-